﻿Imports System
Imports System.Workflow.ComponentModel

Namespace System.Workflow.Activities
    <Serializable> _
    Friend Class SetStateAction
        Inherits StateMachineAction
        ' Methods
        Friend Sub New(ByVal stateName As String, ByVal targetStateName As String)
            MyBase.New(stateName)
            Me._targetStateName = targetStateName
        End Sub

        Friend Overrides Sub Execute(ByVal context As ActivityExecutionContext)
            MyBase.Execute(context)
            MyBase.ExecutionState.CalculateStateTransition(MyBase.CurrentState, Me.TargetStateName)
        End Sub


        ' Properties
        Friend ReadOnly Property TargetStateName As String
            Get
                Return Me._targetStateName
            End Get
        End Property


        ' Fields
        Private _targetStateName As String
    End Class
End Namespace

